package com.hengxinguotong.zhihuichengjian.ui.app;

import android.content.Context;
import android.support.annotation.NonNull;

import com.bumptech.glide.GlideBuilder;
import com.bumptech.glide.annotation.GlideModule;
import com.bumptech.glide.load.engine.cache.DiskCache;
import com.bumptech.glide.load.engine.cache.DiskLruCacheFactory;
import com.bumptech.glide.module.AppGlideModule;
import com.hengxinguotong.zhihuichengjian.utils.CommUtil;

/**
 * TODO
 *
 * @author hjz
 * @version V1.0.0
 * @since 2019/1/9 9:49
 */

@GlideModule
public class MyGlideModule extends AppGlideModule
{
    @Override
    public void applyOptions(@NonNull final Context context, @NonNull final GlideBuilder builder)
    {
        builder.setDiskCache(new DiskLruCacheFactory(CommUtil.getCacheDir(context),
                DiskCache.Factory.DEFAULT_DISK_CACHE_SIZE));
    }

    @Override
    public boolean isManifestParsingEnabled()
    {
        //禁用清单解析，避免添加两次模块
        return false;
    }
}
